<!DOCTYPE html>
	<html>
	<head>
			<meta charset="utf-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<title></title>
			<link rel="stylesheet" href="<?php echo base_url();?>template/style/member.css">
			<style type="text/css">
			.display{
				display: none;

			}
			</style>
			<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
			<script type="text/javascript">
			jQuery(document).ready(function($) {
						$('#result_tk1 tr:even').css({
							background: 'white'
						});
					});
			
				function kt(){
					document.getElementById("dv1").style.display = "block";
					document.getElementById("tt").style.display = "block";
				}
				function dv1(){
					if(document.getElementById("dv1").style.display == "none")
						document.getElementById("dv1").style.display = "block";
					else
						document.getElementById("dv1").style.display = "none";
				}
				function tt(){
					if(document.getElementById("tt").style.display == "none")
						document.getElementById("tt").style.display = "block";
					else
						document.getElementById("tt").style.display = "none";
				}
				jQuery(document).ready(function($) {
					$('#menu ul li a').removeClass('selected');
					$('#menu ul li:nth-child(4) a').addClass('selected').removeAttr('href').css({
						cursor: 'pointer'
					});
						/* Act on the event */
						$('#left-menu ul li a').removeClass('left_select');
						$('#left-menu ul li:nth-child(2) a').addClass('left_select');
				
				});
			var code = <?php echo $this->session->userdata('logged_in')['code']; ?>;
                  	switch(code){
                      case 3:
                      jQuery(document).ready(function($) {
                      $('#menu ul li:first-child').remove();
                      $('#menu ul li:nth-child(4)').remove();
                      $('#menu ul li:last-child').remove();
                    });
                    break;
                  }
                   jQuery(document).ready(function($) {
                  	$('#dv1 ul li:nth-child(2) a').hide();
                  	$('#dv1 ul li:nth-child(3) a').hide();
                  	$('#dv1 ul li:nth-child(4) a').hide();
                  });
			</script>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
	<body onLoad="kt()">
	<?php $this->load->view('layout/header.php'); ?>
		<article>
			<div id="left-menu">
                <!--"<?php echo base_url();?>index.php/donvi"*-->
				<ul>
					<li><a href="#" onClick="dv1()">Đơn Vị</a>
                    	<div id="dv1" style="margin-left:20px">
                            <ul>	
                                 <?php
								 	$url = base_url();
								 	echo '<li><a href="'.$url.'baocao/tatca/">Tất Cả Các Đơn Vị</a></li>';									
									foreach ($data_getdv as $k=>$r){							
										echo '<li class="child_li"><a href = "'.$url.'baocao/donvi/'.$r["MA_DV"].'">'.$r["TEN_DV"].'</a></li>';							
									}
								?>
                            </ul>
                        </div>
                    </li>						
					<li><a href="#" onClick="tt()">Tình Trạng</a>
						<div id="tt" style="margin-left:20px">
                        	<ul>
                                <?php
									$url = base_url();
									foreach ($data_gettt as $k=>$y){
										echo '<li><a href = "'.$url.'baocao/tctinhtrang/'.$y["MA_TT"].'">'.$y["TRANGTHAI"].'</a></li>';							
									}
								?>
							</ul>
                        </div>							
					</li>
				</ul>

			</div><!--End left-menu-->
			<div id="content">
				 <div id="cndv">
                     
                     </p>
                     <br />
                     </div>
                     <p class="level">&nbsp;&nbsp;&nbsp;Chi tiết tình trạng MBA :
                     <table id="bangketqua1">
          				  <tr bgcolor="#CCCCCC">
           				   <td>Số TT</td><td>Số No</td><td>Thời Gian</td><td>Tình Trạng
          				    </td><td>Chi Tiết Tình Trạng</td><td>Ghi Chú</td></tr>
          			      <?php
        			  if (isset($_POST['chitiet_sono']))
          		         {
							  foreach ($cttinhtrang as $k=>$v){
        						$stt=$k+1;
          					    echo"<tr bgcolor='#F0EEEE'>";
             				    echo "<TD>".$stt."</TD>";
               				    echo "<TD>".$v["SONO"]."</TD>";
							  echo "<TD>".$v["NGAYXET_TT"]."</TD>";
							  echo "<TD>".$v["TRANGTHAI"]."</TD>";
							  echo "<TD>".$v["CHITIETTINHTRANGTHIETBI"]."</TD>";
							  echo "<TD>".$v["GHICHU"]."</TD>";
            echo "</tr>";
            }
                   }
        ?>
                </table>
                </p>
                <p class="level">&nbsp;&nbsp;&nbsp;Quá trình sử dụng MBA :
                <table id="bangketqua2">
          				  <tr bgcolor="#CCCCCC">
           				   <td>Số TT</td><td>Số No</td><td>Tên Trạm</td><td>Ngày Bắt Đầu
          				    </td><td>Ngày Kết Thúc</td><td>Địa Chỉ Trạm</td></tr>
          			      <?php
        			  if (isset($_POST['chitiet_sono']))
          		         {
							  foreach ($ctsudung as $k=>$v){
        						$stt=$k+1;
          					    echo"<tr bgcolor='#F0EEEE'>";
             				    echo "<TD>".$stt."</TD>";
               				    echo "<TD>".$v["SONO"]."</TD>";
							  echo "<TD>".$v["TENTRAM"]."</TD>";
							  echo "<TD>".$v["NGAY_BD"]."</TD>";
							  echo "<TD>".$v["NGAY_KT"]."</TD>";
							  echo "<TD>".$v["DIACHITRAM"]."</TD>";
            echo "</tr>";
            }
                   }
        ?>
                </table></p>
                 <p class="level">&nbsp;&nbsp;&nbsp;Chi tiết Đại Tu MBA :
                 <table id="bangketqua3">
          				  <tr bgcolor="#CCCCCC">
           				   <td>Số TT</td><td>Số No</td><td>Đại Tu</td><td>Ngày</td><td>Ghi Chú
          				    </td></tr>
          			      <?php
        			  if (isset($_POST['chitiet_sono']))
          		         {
							  foreach ($ctdaitu as $k=>$v){
        						$stt=$k+1;
          					    echo"<tr bgcolor='#F0EEEE'>";
             				    echo "<TD>".$stt."</TD>";
               				    echo "<TD>".$v["SONO"]."</TD>";
							  echo "<TD>".$v["TEN_DAITU"]."</TD>";
							   echo "<TD>".$v["NGAYDAITU"]."</TD>";
							  echo "<TD>".$v["ND_DAITU"]."</TD>";
							  
            echo "</tr>";
            }
                   }
        ?>
                </table></p>
			<div class="clear">

			</div><!--End clear-->
		</article>
		<?php $this->load->view('layout/footer'); ?>
	</body>
</html>